<form class="layui-form" action="" lay-filter="parentsForm">
    <input name="id" type="hidden">
     <div class="layui-form-item">
            <label class="layui-form-label">主键</label>
            <div class="layui-input-block">
            </div>
       </div>
     <div class="layui-form-item">
            <label class="layui-form-label">请假</label>
            <div class="layui-input-block">
                    <input type="text" name="leave" lay-verify="required" autocomplete="off" placeholder="请输入名称" class="layui-input">
            </div>
       </div>
     <div class="layui-form-item">
            <label class="layui-form-label">家长姓名</label>
            <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入名称" class="layui-input">
            </div>
       </div>
     <div class="layui-form-item">
            <label class="layui-form-label">学生证号</label>
            <div class="layui-input-block">
            </div>
       </div>
     <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
            </div>
       </div>
     <div class="layui-form-item">
            <label class="layui-form-label">乐观锁</label>
            <div class="layui-input-block">
            </div>
       </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    layui.use(["jquery","form"],function () {
        var $=layui.jquery,form=layui.form;
        form.on('submit(demo1)', function(data){
            $.ajax({
                url:"/parents/updateParents",
                data:data.field,
                dataType:"json",
                type:"post",
                success:function (msg) {
                    if (msg.code==0){
                        tableIns.reload({
                            page:{
                                curr:1
                            }
                        });
                        layer.msg(msg.msg);
                        layer.close(openIndex);
                    }else{
                        layer.msg(msg.msg);
                    }
                }
            });
            return false;
        });
    });
</script>